package com.itqf.dao;

import com.itqf.pojo.Cart;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

/**
 * projectName: gpshop
 *
 * @author: 赵伟风
 * time: 2021/7/22 20:36
 * description:
 */
public interface CartDao {

    /**
     * 检查购物车是否存在
     * @param uId
     * @param gId
     * @return
     */
    Cart check(int uId, String gId) throws SQLException;

    /**
     * 修改购物车数量和小计
     * @param cart
     */
    void updateCart(Cart cart) throws SQLException;

    /**
     * 添加购物车数据
     * @param cart
     */
    void insertCart(Cart cart) throws SQLException;

    /**
     * 数据库多表查询!
     * @param uId
     * @return
     */
    List<Map<String, Object>> queryAll(int uId) throws SQLException;
}
